<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>his登录</title>
    <%@include file="common.jsp"%>
    <link rel="stylesheet" href="${path}/assets/css/login/login.css">
</head>
<body>
<div class="login_box">
    <div class="login_l_img"><img src="${path}/assets/images/login/login-img.png" /></div>
    <div class="login">
        <div class="login_logo"><a href="#"><img src="${path}/assets/images/login/login_logo.png" /></a></div>
        <div class="login_name">
            <p>his管理系统</p>
        </div>
        <form method="post" id="userForm">
            <input name="username" id="username" type="text" placeholder="用户名" >
            <input name="password" type="password" id="password" placeholder="密码"/>
            <input value="登录" style="width:100%;" type="submit" onclick="login();return false">
        </form>
    </div>
    <%--<div class="copyright">H03班 版权所有©2017-2018 技术支持电话：18832089047</div>--%>
</div>
<script>
    layui.use(['layer','form'],function () {

    })
    function login() {

        if ($("#username").val() == null || $("#username").val() == ''){
            layer.tips('请输入用户名', '#username');
            return;
        }
        if ($("#password").val() == null || $("#password").val() == ''){
            layer.tips('请输入密码', '#password');
            return;
        }

        var parems = $("#userForm").serialize();
        $.post("${path}/user/login",parems,function (data) {
            if (data.code != 0){
                layer.msg(data.msg,{icon:5})
            }else{
                layer.msg("登录成功！",{icon:6,time:1000},function () {
                    location.href="${path}/user/main"
                })
            }
        })
    }
</script>
</body>
</html>
